//
//  ZLPullMenuContentReusableView.m
//  ZLPullMenu
//
//  Created by 赵振磊 on 2024/5/27.
//

#import "ZLPullMenuContentReusableView.h"
#import <Masonry/Masonry.h>

@interface ZLPullMenuContentReusableView()
/// 标题
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation ZLPullMenuContentReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(UIEdgeInsetsZero);
        }];
    }
    return self;
}

- (void)setGroup:(ZLPullMenuGroup *)group {
    _group = group;
    self.titleLabel.textColor = group.config.textColor;
    self.titleLabel.font = group.config.font;
    self.titleLabel.text = group.groupTitle;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
    }
    return _titleLabel;
}

@end
